<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</h
ead>
<body>
	<script type="text/javascript">
		//装饰器
		Function.prototype.before = function(beforeFn){
			var _this=this;
			console.log(arguments[0]);
			console.log(this);
			return function(){
				console.log(this);
				console.log(_this);
				console.log(arguments[0]);
				beforeFn.apply(this, arguments)
				console.log(arguments[0]);
				return _this.apply(this, arguments)
			}
		};
		var add=function(param){
			console.log(param);
		}
		add=add.before(function(param){
			console.log(param);
			param.b='b'   
		})
		add({b:22})
	</script>
</body>
</html>